﻿// ***********************************************************************
// Assembly         : OSS.Doc
// Author           : tianteng
// Created          : 04-27-2020
//
// Last Modified By : tianteng
// Last Modified On : 04-29-2020
// ***********************************************************************
// <copyright file="NewLineStringCmd.cs" company="北京智帆高科科技有限公司">
//     Copyright ©  2020
// </copyright>
// <summary></summary>
// ***********************************************************************

using System.Collections.Generic;
using Osg;
using ZFGK.Addins;
using ZFGK.OSG.DocUI;
using ZFGK.OSG.DocUI.CmdEnables;
using ZFGK.OSG.UI.Actions;

namespace OSS.Doc.Cmds
{
    /// <summary>
    /// Class NewLineStringCmd.
    /// Implements the <see cref="ZFGK.Addins.IExtendCommand" />
    /// </summary>
    /// <seealso cref="ZFGK.Addins.IExtendCommand" />
    [OnlyDocCmdEnable]
    class NewLineStringCmd : IExtendCommand
    {
        /// <summary>
        /// Executes the specified command data.
        /// </summary>
        /// <param name="cmdData">The command data.</param>
        /// <param name="message">The message.</param>
        /// <returns>CmdResult.</returns>
        public CmdResult Execute(ExtendCmdData cmdData, ref string message)
        {
            var docViewForm = cmdData.ViewForm as IViewForm;
            if (docViewForm == null) return CmdResult.Cancel;

            var osgViewCtrl = docViewForm.View as ZfOsgDocViewCtrl;
            var actionUtility = osgViewCtrl.ActionUtility;
            var activeDocument = osgViewCtrl.ActiveDocument;

            List<Vec3d> verts = new List<Vec3d>();
            while (true)
            {
                Vec3d worldPt1;
                if (!actionUtility.PickPoint("选择起点", out worldPt1, delegate(PickPointAction action)
                {
                    //action.k;
                }))
                {
                    return CmdResult.Cancel;
                }
            }

            return CmdResult.Succeed;
        }
    }
}
